<?php 
class IndexController extends DomController {
	
	public function index() {
		$this->view->contents = '<h1>Samples site</h1>';
	}
	
	public function error404() {
		$this->view->index = '';
		$this->view->addPartitioner('contents', 'Errors/error404.html');
	}

	public function setup() {
		
		$menu = array(
			'type' => 'menu',
			'items' => array(
				
				array(
					'title' => 'DomSite',
					'items' => array(
						array(
							'title' => 'Coding standard',
							'link' => $this->getSiteUrl('DomSite/codingStandard'),
							'separator'=>true,
						),
						array(
							'title' => 'Url-s',
							'link' => $this->getSiteUrl('DomSite/urls'),
						),
						array(
							'title' => 'Site',
							'link' => $this->getSiteUrl('DomSite/siteSetup'),
						),
						array(
							'title' => 'Controllers',
							'link' => $this->getSiteUrl('DomSite/controllers'),
						),
						array(
							'title' => 'Views / Templates',
							'link' => $this->getSiteUrl('DomSite/templates'),
							'separator'=>true,
						),
						array(
							'title' => 'Setting up new site',
							'link' => $this->getSiteUrl('DomSite/settingUp'),
						),
						array(
							'title' => 'Setting up new sub site',
							'link' => $this->getSiteUrl('DomSite/settingUpSubSite'),
						),
						array(
							'title' => 'Setting up languages',
							'link' => $this->getSiteUrl('DomSite/languages'),
						),
					),
				),
				array(
					'title' => 'DomAr',
					'items' => array(
						array(
							'title' => 'Basics',
							'link' => $this->getSiteUrl('DomAr/basics/'),
						),
						array(
							'title' => 'Annotations',
							'link' => $this->getSiteUrl('DomAr/annotations/'),
						),
						array(
							'title' => 'Relations',
							'items' => array(
								array(
									'title' => 'One to one',
									'link' => $this->getSiteUrl('DomAr/oneToOne/'),
								),
								array(
									'title' => 'One to many',
									'link' => $this->getSiteUrl('DomAr/oneToMany/'),
								),
								array(
									'title' => 'Many to many',
									'link' => $this->getSiteUrl('DomAr/manyToMany/'),
								),
							),
						),
						array(
							'title' => 'Listeners',
							'link' => $this->getSiteUrl('DomAr/listeners/'),
						),
						array(
							'title' => 'Validators',
							'link' => $this->getSiteUrl('DomAr/validators/'),
							'items' => array(
								array(
									'title' => 'Validators',
									'link' => $this->getSiteUrl('DomAr/validators'),
								),
								array(
									'title' => 'Validator error codes',
									'link' => $this->getSiteUrl('DomAr/validatorErrorCodes'),
								),
							),
						),
						array(
							'title' => 'Queries',
							'items' => array(
								array(
									'title' => 'Object queries',
									'link' => $this->getSiteUrl('DomAr/objectQueries'),
								),
								array(
									'title' => 'Raw SQL queries',
									'link' => $this->getSiteUrl('DomAr/sqlQueries'),
								),
							),
						),
						array(
							'title' => 'Plugins',
							'link' => $this->getSiteUrl('DomArPlugins/'),
							'items' => array(
								array(
									'title' => 'Date',
									'link' => $this->getSiteUrl('DomAr/pluginDomArDate'),
								),
								array(
									'title' => 'DateTime',
									'link' => $this->getSiteUrl('DomAr/pluginDomArDateTime'),
								),
								array(
									'title' => 'File',
									'link' => $this->getSiteUrl('DomAr/pluginDomArFile'),
								),
								array(
									'title' => 'Image',
									'link' => $this->getSiteUrl('DomAr/pluginDomArImage'),
								),
								array(
									'title' => 'Access-control-list (ACL)',
									'link' => $this->getSiteUrl('DomAr/pluginDomArAcl'),
								),
								array(
									'title' => 'Simple order',
									'link' => $this->getSiteUrl('DomAr/pluginSimpleOrder'),
								),
								array(
									'title' => 'Slug',
									'link' => $this->getSiteUrl('DomAr/pluginSlug'),
								),
								array(
									'title' => 'History',
									'link' => $this->getSiteUrl('DomAr/pluginHistory'),
								),
								array(
									'title' => 'Change log',
									'link' => $this->getSiteUrl('DomAr/pluginChangeLog'),
								),
								array(
									'title' => 'Search index',
									'link' => $this->getSiteUrl('DomAr/pluginSearchIndex'),
								),
							),
						),
						array(
							'title' => 'Class elements',
							'link' => $this->getSiteUrl('DomAr/classElements/'),
						),
						array(
							'title' => 'Extending classes',
							'link' => $this->getSiteUrl('DomAr/extendingClasses/'),
						),
						array(
							'title' => 'Custom property handlers',
							'items' => array(
								array(
									'title' => 'How parser works?',
									'link' => $this->getSiteUrl('DomAr/parsing/'),
								),
								array(
									'title' => 'Custom property handlers',
									'link' => $this->getSiteUrl('DomAr/customPropertyHandlers'),
								),
								array(
									'title' => 'Property handler interfaces',
									'link' => $this->getSiteUrl('DomAr/propertyHandlerInterfaces'),
								),
								array(
									'title' => 'Custom annotations',
									'link' => $this->getSiteUrl('DomAr/customAnnotations/'),
								),
							),
						),
						array(
							'title' => 'Serialize',
							'link' => $this->getSiteUrl('DomAr/serialize/'),
						),
						array(
							'title' => 'Cheat sheet',
							'link' => $this->getSiteUrl('DomAr/cheatSheet/'),
						),
					),
				),
				array(
					'title' => 'DomFG',
					
					'items' => array(
						array(
							'title' => 'When making forms...',
							'link' => $this->getSiteUrl('DomFg/when'),
						),
						array(
							'title' => 'Forms',
							'items' => array(
								array(
									'title' => 'Panels',
									'link' => $this->getSiteUrl('DomFg/panel'),
								),
								array(
									'title' => 'Tab Panel',
									'link' => $this->getSiteUrl('DomFg/tabPanel'),
								),
								array(
									'title' => 'Inner tab Panel',
									'link' => $this->getSiteUrl('DomFg/innerTabPanel'),
								),
								array(
									'title' => 'Custom html',
									'link' => $this->getSiteUrl('DomFg/customHtml'),
								),
								array(
									'title' => 'All inputs',
									'link' => $this->getSiteUrl('DomFg/allInputs'),
								),
								array(
									'title' => 'Input list',
									'link' => $this->getSiteUrl('DomFg/inputList'),
								),
								array(
									'title' => 'Input list with DomAr',
									'link' => $this->getSiteUrl('DomFg/inputListReal'),
								),					
								array(
									'title' => 'Calendar',
									'link' => $this->getSiteUrl('DomFg/calendar'),
								),
								array(
									'title' => 'All messages',
									'link' => $this->getSiteUrl('DomFg/allMessages'),
								),
								array(
									'title' => 'Simple login form 1',
									'link' => $this->getSiteUrl('DomFg/loginForm1'),
								),
								array(
									'title' => 'Simple login form 2',
									'link' => $this->getSiteUrl('DomFg/loginForm2'),
								),
								array(
									'title' => 'Complex form',
									'link' => $this->getSiteUrl('DomFg/complexForm'),
								),
								array(
									'title' => 'Refreshing with errors',
									'link' => $this->getSiteUrl('DomFg/inputRefreshing'),
								),
								array(
									'title' => 'Html editor images plugin',
									'link' => $this->getSiteUrl('DomFg/htmlEditorImages'),
								),
								array(
									'title' => 'Filebrowser',
									'link' => $this->getSiteUrl('DomFg/fileBrowser'),
								),
								array(
									'title' => 'Multiple file upload',
									'link' => $this->getSiteUrl('DomFg/upload'),
								),
								array(
									'title' => 'Search select (Ajax)',
									'link' => $this->getSiteUrl('DomFg/ajaxSearchSelect'),
								),
							),
						),
						array(
							'title' => 'Grid',
							'items' => array(
								array(
									'title' => 'Simple array grid',
									'link' => $this->getSiteUrl('DomFg/simpleGrid'),
								),
								array(
									'title' => 'Advanced DomArObject grid',
									'link' => $this->getSiteUrl('DomFg/advancedGrid'),
								),
								array(
									'title' => 'Image grid',
									'link' => $this->getSiteUrl('DomFg/imageGrid'),
								),
							),
						),
						array(
							'title' => 'Other',
							'items' => array(
								array(
									'title' => 'Tooltips',
									'link' => $this->getSiteUrl('DomFg/tooltips'),
								),
								array(
									'title' => 'Tree',
									'link' => $this->getSiteUrl('DomFg/tree'),
								),
							),
						),
						
						/*array(
							'title' => 'Start code',
							'items' => array(
								array(
									'title' => 'List starter',
									'link' => $this->getSiteUrl('DomFg/listStarter'),
								),
								array(
									'title' => 'Search list starter',
									'link' => $this->getSiteUrl('DomFg/listSearchStarter'),
								),
								array(
									'title' => 'Form starter',
									'link' => $this->getSiteUrl('DomFg/formStarter'),
								),
							),
						),*/
						array(
							'title' => 'Eclipse templates',
							'items' => array(
								array(
									'title' => 'Using eclipse templates',
									'link' => $this->getSiteUrl('DomFg/eclipse_using'),
								),
								array(
									'title' => 'Form starter',
									'link' => $this->getSiteUrl('DomFg/eclipse_DomFgF'),
								),
								array(
									'title' => 'Tabbed form starter',
									'link' => $this->getSiteUrl('DomFg/ecplipse_DomFgTF'),
								),
								array(
									'title' => 'List starter',
									'link' => $this->getSiteUrl('DomFg/ecplipse_DomFgL'),
								),
								array(
									'title' => 'Search list starter',
									'link' => $this->getSiteUrl('DomFg/ecplipse_DomFgSL'),
								),
							),
						),
						array(
							'title' => 'Article sample',
							'items' => array(
								array(
									'title' => 'About this sample',
									'link' => $this->getSiteUrl('Article/about/'),
								),
								array(
									'title' => 'Categories',
									'link' => $this->getSiteUrl('Article/categories/'),
								),
								array(
									'title' => 'Articles',
									'link' => $this->getSiteUrl('Article/articles/'),
								),
								array(
									'title' => 'Add article',
									'link' => $this->getSiteUrl('Article/manageArticle/0/'),
								),
							),
						),
					),
				),
				array(
					'title' => 'DomBase',
					'items' => array(
						array(
							'title' => 'Functions',
							'link' => $this->getSiteUrl('DomBase/functions'),
						),
					),
				),
				array(
					'title' => 'DomAuth',
					'link' => $this->getSiteUrl('DomAuth/domauth'),
				),
				array(
					'title' => 'DomPager',
					'link' => $this->getSiteUrl('DomPager/pager/'),
				),
				array(
					'title' => 'DomMonitor',
					'link' => $this->getSiteUrl('DomMonitor'),
				),
				array(
					'title' => 'DomBankLink',
					'items' => array(
						array(
							'title' => 'Creating certs',
							'link' => $this->getSiteUrl('DomBankLink/settingUp/'),
							'separator' => true,
						),
						array(
							'title' => 'Make payment',
							'link' => $this->getSiteUrl('DomBankLink/'),
						),
						array(
							'title' => 'Log',
							'link' => $this->getSiteUrl('DomBankLink/log/'),
							'separator' => true,
						),
						
						array(
							'title' => 'Identify',
							'link' => $this->getSiteUrl('DomBankLink/identify'),
						),
					),
				),
			),
		);
	
		$this->view->menu = DomFg::render( $menu );
	}
	
	public function finalize() {
		$this->view->head = DomFg::renderHead();
		$this->view->header = DomFg::renderHeader();
		$this->view->footer = DomFg::renderFooter();
	}
}
?>